package cn.kgc.tangcco.liahozhe.spring.b_create_object;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.kgc.tangcco.liahozhe.spring.pojo.User;

public class App {
	private ApplicationContext context = new ClassPathXmlApplicationContext("cn/kgc/tangcco/liahozhe/spring/b_create_object/bean.xml");
	@Test
	public void test01() {
		System.out.println("----容器创建完成----");
		User user01 = (User) context.getBean("user01");
		User user02 = (User) context.getBean("user01");
		user01.setName("李哲");
		System.out.println(user01.getName());
		System.out.println(user02.getName());
	}
	@Test
	public void test02() {
		System.out.println("----容器创建完成----");
		User user01 = (User) context.getBean("user02");
		User user02 = (User) context.getBean("user02");
		System.out.println(user01.getName());
		System.out.println(user02.getName());
	}
	@Test
	public void test03() {
		System.out.println("----容器创建完成----");
		User user01 = (User) context.getBean("user03");
		User user02 = (User) context.getBean("user03");
		System.out.println(user01.getName());
		System.out.println(user02.getName());
	}
	@Test
	public void test04() {
		System.out.println("----容器创建完成----");
		User user01 = (User) context.getBean("user04");
		User user02 = (User) context.getBean("user04");
		System.out.println(user01.getName());
		System.out.println(user02.getName());
	}
	@Test
	public void test05() {
		System.out.println("----容器创建完成----");
		User user01 = (User) context.getBean("user05");
		User user02 = (User) context.getBean("user05");
		System.out.println(user01.getName());
		System.out.println(user02.getName());
	}
	@Test
	public void test06() {
		System.out.println("----容器创建完成----");
		User user01 = (User) context.getBean("user06");
		User user02 = (User) context.getBean("user06");
		System.out.println(user01.getName());
		System.out.println(user02.getName());
	}
	@Test
	public void test07() {
		System.out.println("----容器创建完成----");
		User user01 = (User) context.getBean("user07");
		User user02 = (User) context.getBean("user07");
		System.out.println(user01.getName());
		System.out.println(user02.getName());
	}
}
